package com.miya.archetype.common.dal.config;

//import com.miya.archetype.common.dal.entity.TradeDO;
//import com.miya.archetype.common.dal.entity.TradeDO;
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.env.Environment;
import org.springframework.core.io.ClassPathResource;

import javax.annotation.Resource;

//@Configuration
public class BootStrapConfiguration {

    @Resource
    private Environment environment;

	@Bean
    public String propertySourcesPlaceholderConfigurer() {
	    System.out.println("zeng active: " + environment.getActiveProfiles()[0]);
//        PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
//        YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
//        yaml.setResources(new ClassPathResource("META-INF/spring/common-dal-" + profile + ".yml"));
//        propertySourcesPlaceholderConfigurer.setProperties(yaml.getObject());//   /Users/nolan4954/Documents/springboot-demo
        return null;
    }
}
